//package com.zmn.plat.dubbo.impl.product.categorybrand;
//
//import com.zmn.common.constant.GlobalConsts;
//import com.zmn.common.dictionary.GlobalDict;
//import com.zmn.common.dto2.ResponseDTO;
//import com.zmn.common.utils.number.NumberUtil;
//import com.zmn.manager.common.database.annotation.ReadOnlyConnection;
//import com.zmn.plat.business.interfaces.product.categorybrand.CategoryBrandBService;
//import com.zmn.plat.common.dto.brand.BaseBrandDRO;
//import com.zmn.plat.common.dto.product.categorybrand.CategoryBrandDRO;
//import com.zmn.plat.common.exception.PlatException;
//import com.zmn.plat.dubbo.interfaces.product.categorybrand.CategoryBrandListRemoteService;
//import com.zmn.plat.dubbo.utils.DubboConsts;
//import com.zmn.plat.model.entity.brand.BaseBrand;
//import com.zmn.plat.model.entity.brand.BaseBrandQuery;
//import com.zmn.plat.model.entity.product.categorybrand.CategoryBrandQuery;
//import com.zmn.plat.services.interfaces.brand.BaseBrandService;
//import com.zmn.plat.services.interfaces.product.categorybrand.CategoryBrandService;
//import com.zmn.plat.utils.bean.BeanCopyUtils;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.dubbo.config.annotation.Service;
//
//import javax.annotation.Resource;
//import java.util.Collections;
//import java.util.List;
//import java.util.Optional;
//import java.util.stream.Collectors;
//
///**
// * @author tanbiao
// * @description
// * @modifier
// * @since 2020/8/25 11:21
// **/
//@Slf4j
//@Service(version = DubboConsts.INTERFACE_VERSION, validation = "true")
//public class CategoryBrandListRemoteServiceImpl implements CategoryBrandListRemoteService {
//    @Resource
//    private CategoryBrandBService categoryBrandBService;
//    @Resource
//    private CategoryBrandService categoryBrandService;
//    @Resource
//    private BaseBrandService baseBrandService;
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<CategoryBrandDRO>> listBrandByProductId(Integer productId) {
//        log.info("listBrandByProductId 参数为：productId={}", productId);
//
//        try {
//            List<CategoryBrandDRO> list = categoryBrandBService.listBrandByProductId(productId);
//            return ResponseDTO.success(list);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            log.error("listBrandByProductId error,参数为：productId={}", productId, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<CategoryBrandDRO>> listBrandByCategIds(Integer servCategId,Integer categOneId,Integer categId) {
//        try {
//            List<CategoryBrandDRO> list = categoryBrandBService.listBrandByCategIds(servCategId,categOneId,categId);
//            return ResponseDTO.success(list);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            log.error("listBrandGroupByBrandId error", e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<BaseBrandDRO>> listBrandByCategId(Integer categId) {
//
//        try {
//            List<BaseBrandDRO> baseBrandDROS = categoryBrandBService.listBrandByCategId(categId);
//            return ResponseDTO.success(baseBrandDROS);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            log.error("CategoryBrandListRemoteServiceImpl.listBrandByCategId查询失败,原因:{}", e.getMessage(), e);
//            return ResponseDTO.fail("查询失败，程序异常");
//        }
//
//    }
//}
